home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 4
/
The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO
/
wp
/
tseacc13.zip
/
TSEACC13.S
< prev
next >
Wrap
Text File
|
1993-06-21
|
6KB
|
171 lines
/**************** Foreign-Character Macros **************************
For TSE (The Semware Editor), pre-release version 1.0
Author: David Mayerovitch
macro version 1.0 07 June 1993
macro version 1.1 12 June 1993
- added Spanish, more French characters
- removed International
macro version 1.2 15 June 1993
- added Spanish ordinals
macro version 1.3 20 June 1993
- macro source code uses Chr() notation rather than
character literals to preserve valid code if this
text should somehow pass through a high-ASCII filter
- minor documentation errors fixed
The documentation portion of this text contains high-ASCII
characters which will not appear correctly if the file reaches you
after somehow passing through a high-ASCII filter. However, in the
actual source code below, the Chr() notation ensures correct
compilation and functioning of the macro.
-------------------
This pair of macros provides a quick and convenient way of entering
foreign-language and other special characters.
mSelectLanguage() presents a menu of languages or other
special-character sets for the user to choose from. I have assigned
this macro to <Alt `>.
mAccenter() enables the entry of the special characters belonging to
the selected set. I have assigned this macro to the key <`>. Call
this the trigger key.
These macros do what you do when writing foreign characters by hand:
first write the basic letterform, then add the diacritical mark.
Example: If the selected language is French and you want to enter
the character <é> (e with accent aigu): type the basic character <e>,
then press the trigger key. A pop-up menu appears:
┌──────────┐
│ Aigu é │
│ Grave è │
│ Circ ê │
│ Umlaut ë │
└──────────┘
The hotkeys A, G, C, and U generate the four possible e-based
accented characters in French. Press <A> and the <e> just
typed will be replaced with <é>.
When there is only one possible accented version of the character
just typed (e.g. ü in German), the macro automatically inserts it
without popping up a menu.
The macros as presented here offer the following character sets:
French: à â ç Ç é è ê ë É î ï ô ù û
German: ä Ä ö Ö ü Ü
Spanish: á ª é í ó º ú ñ Ñ ¿ ¡
Currency: c/C --> ¢ (cents) l/L --> £ (pounds) y/Y --> ¥ (yen)
French is the default: it is automatically selected when the macro
is loaded. Change the default by changing the global variable
Language (see macro source below).
You may easily edit the macros to provide any substitutions you
want. Strings as well as single characters may be substituted: the
string "integer" could be expanded from "i", or your name from your
initial. Modify the language menu to provide character sets of your
choice - math, Greek, graphics, and so on.
If you have occasional need for characters from different languages,
you might group them into a single International set rather than
switching languages. The tradeoff would be that you'd have fewer
automatic substitutions and more menu choices.
If a printable key such as <`> is chosen as the trigger for
mAccenter(), the Literal() command (assigned to <Ctrl P> in the
factory configuration of TSE) may be used whenever the character
itself is required in the text.
Comments and improvements are welcome.
********************************************************************/
// MACRO SOURCE CODE
integer language = 1 // French is default (make it 3 for Spanish)
// LANGUAGE SELECTION ROUTINES:
menu langMenu() history
'&French' '&German' '&Spanish' '', , Divide '&Currency'
end
proc mSelectLanguage()
langMenu() language = MenuOption()
end
// CHARACTER SUBSTITUTION ROUTINES:
proc sub(string newstring)
// replaces current char by newstring, forcing insert.
DelChar() InsertText(newstring,_insert_)
end
menu FrenchAMenu()
'&Grave '+Chr(133), sub(Chr(133))
'&Circ '+Chr(131), sub(Chr(131)) end
menu FrenchEMenu()
'&Aigu '+Chr(130), sub(Chr(130))
'&Grave '+Chr(138), sub(Chr(138))
'&Circ '+Chr(136), sub(Chr(136))
'&Umlaut '+Chr(137), sub(Chr(137)) end
menu FrenchIMenu()
'&Circ '+Chr(140), sub(Chr(140))
'&Umlaut '+Chr(139), sub(Chr(139)) end
menu FrenchUMenu()
'&Grave '+Chr(151), sub(Chr(151))
'&Circ '+Chr(150), sub(Chr(150)) end
menu SpanishOMenu()
'&Accent '+Chr(162), sub(Chr(162))
'&Ordinal '+Chr(167), sub(Chr(167)) end
menu SpanishAMenu()
'&Accent '+Chr(160), sub(Chr(160))
'&Ordinal '+Chr(166), sub(Chr(166)) end
proc French()
case Chr(CurrChar())
when 'a' FrenchAMenu() when 'e' FrenchEMenu()
when 'i' FrenchIMenu() when 'u' FrenchUMenu()
when 'E' sub(Chr(144)) when 'c' sub(Chr(135))
when 'C' sub(Chr(128))
when 'i' sub(Chr(140)) when 'o' sub(Chr(147))
otherwise Right() endcase
end
proc German()
case Chr(CurrChar())
when 'a' sub(Chr(132)) when 'A' sub(Chr(142))
when 'o' sub(Chr(148)) when 'O' sub(Chr(153))
when 'u' sub(Chr(129)) when 'U' sub(Chr(154))
otherwise Right() endcase
end
proc Spanish()
case Chr(CurrChar())
when 'a' SpanishAMenu() when 'o' SpanishOMenu()
when 'e' sub(Chr(130)) when 'i' sub(Chr(161))
when 'u' sub(Chr(163)) when 'n' sub(Chr(164))
when 'N' sub(Chr(165))
when '?' sub(Chr(168)) when '/' sub(Chr(168))
// unshifted ? key
when '!' sub(Chr(173)) when '1' sub(Chr(173))
// unshifted ! key
otherwise Right() endcase
end
proc Currency()
case UpCase(Chr(CurrChar()))
when 'C' sub(Chr(155)) // cents
when 'L' sub(Chr(156)) // pounds
when 'Y' sub(Chr(157)) // yen
otherwise Right() endcase
end
proc mAccenter()
Left()
Case language
when 1 French() when 2 German() when 3 Spanish()
when 5 Currency()
endcase
end
<`> mAccenter()
<Alt `> mSelectLanguage()
/************************** End of macros **************************/